<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page language="java" import="com.server.web.JsVersionUtil"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
	<meta charset="UTF-8">
	<title>北京市人民政府外事办公室领事保护教育服务平台</title>
	<!-- 新 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="<c:url value='/share/bootstrap.min.css'></c:url>">
	<link rel="stylesheet" href="<c:url value='/share/AllStyle.css'></c:url>">
	<link rel="stylesheet" href="<c:url value='/share/hDate.css'></c:url>">
	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="<c:url value='/js/jquery.min.js'></c:url>"></script>
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="<c:url value='/js/bootstrap.min.js'></c:url>"></script>
	<script src="<c:url value='/js/hDate.js'></c:url>"></script>
	<script src="<c:url value='/js/all.js'></c:url>"></script>
	<script src="<c:url value='/js/serverCommonJs.js'></c:url>"></script>
	<script src="<c:url value='/js/rqfCommon/rqfCommon.js'></c:url>"></script>
	<style>
		.table>thead:first-child>tr:first-child>th{
			font-weight: 300;
		}
		.table>thead>tr>th{
			border-bottom: 0;
		}
	</style>
</head>
<body>
	<div class="home_header_2">
		<div class="Interface_center Interface_relative">
			<ul>
				<li>
					<div>案例类型：</div>
					<ul class="Interface_relative" id="Case_Type">
						<li>
							<div class="form-group" style="margin-bottom: 0;text-decoration: none;">
							    <select class="form-control" style="padding: 2px 10px;" id="Case_Type1"> 
							      <option>请选择类型一</option> 
							      <option value="突发">突发</option> 
							      <option value="非突发">非突发</option> 
							    </select>
							</div>
						</li>
						<li>
							<div class="form-group" style="margin-bottom: 0;text-decoration: none;">
							    <select class="form-control" style="padding: 2px 10px;" id="Case_Type2"> 
							      <option>请选择类型二</option> 
							      <option value="领事保护">领事保护</option> 
							      <option value="领事协助">领事协助</option> 
							    </select>
							</div>
						</li>
						<li>
							<div class="form-group" style="margin-bottom: 0;text-decoration: none;">
							    <select class="form-control" style="padding: 2px 10px;" id="Case_Type3"> 
							      <option>请选择类型三</option> 
							      <option value="政局动荡">政局动荡</option> 
							      <option value="恐怖袭击">恐怖袭击</option> 
							      <option value="社会治安">社会治安</option>
							      <option value="自然灾害">自然灾害</option>
							      <option value="意外事故">意外事故</option>
							      <!-- <option value="恐怖袭击">恐怖袭击</option> -->
							      <option value="劳务纠纷">劳务纠纷</option>
							    </select>
							</div>
						</li>
					</ul>
				</li>
				<li>
					<div>发生时间：</div>
					<ul id="WH_TextTime" class="Interface_relative">
						<li>
							<div class="form-group" style="margin-bottom: 0;text-decoration: none;">
							    <input id="Text2" type="button" value="起始日期" style="background: #fff;border: 1px solid #ccc;padding: 2px 10px;border-radius: 4px;color: #555;width: 128px;cursor:pointer;"/>
							</div>
						</li>
						<li>
							<div class="form-group" style="margin-bottom: 0;text-decoration: none;">
							    <input id="Text3" type="button" value="结束日期" style="background: #fff;border: 1px solid #ccc;padding: 2px 10px;border-radius: 4px;color: #555;width: 128px;cursor:pointer;"/>
							</div>
						</li>
					</ul>
				</li>
				<li>
					<div>国家&frasl;地区：</div>
					<ul class="Interface_relative">
						<li>
							<div class="form-group" style="margin-bottom: 0;text-decoration: none;">
							    <select class="form-control" style="padding: 2px 10px;" id="Case_Country_Area_select"> 
							      <option>请选择国家/地区</option> 
							    </select>
							</div>
						</li>
					</ul>
				</li>
				<li>
					<div>辖区范围：</div>
					<ul class="Interface_relative">
						<li>
							<div class="form-group" style="margin-bottom: 0;text-decoration: none ;width: 250px;">
							    <input type="text" id="Case_Range" class="form-control" style="padding: 2px 12px;" placeholder="请输入辖区范围">
							</div>
						</li>
					</ul>
				</li>
				<li style="display:none; !important;">
					<div>涉事人数：</div>
					<ul class="Interface_relative" id="Case_PeopleNumber">
						<li><a href="javascript:;" class="home_header_2_Click">不限</a></li>
						<li><a href="javascript:;" value="1">10以下</a></li>
						<li><a href="javascript:;" value="2">10~50</a></li>
						<li><a href="javascript:;" value="3">50~100</a></li>
						<li><a href="javascript:;" value="4">100以上</a></li>
					</ul>
				</li>
				<li>
					<div>出境目的：</div>
					<ul class="Interface_relative" id="Case_Exit_Purpose">
						<li><a href="javascript:;" class="home_header_2_Click">不限</a></li>
						<li><a href="javascript:;">旅游</a></li>
						<li><a href="javascript:;">务工</a></li>
						<li><a href="javascript:;">留学</a></li>
						<li><a href="javascript:;">科技交流</a></li>
						<li><a href="javascript:;">会议</a></li>
						<li><a href="javascript:;">商贸谈判</a></li>
					</ul>
				</li>
				<li style="">
					<div>受伤人数：</div>
					<ul class="Interface_relative" id="Case_CasualtiesNumber">
						<li><a href="javascript:;" class="home_header_2_Click">不限</a></li>
						<li><a href="javascript:;" value="1">10以下</a></li>
						<li><a href="javascript:;" value="2">10~50</a></li>
						<li><a href="javascript:;" value="3">50~100</a></li>
						<li><a href="javascript:;" value="4">100以上</a></li>
					</ul>
				</li>
				<li style="">
					<div>死亡人数：</div>
					<ul class="Interface_relative" id="Case_DeathNumber">
						<li><a href="javascript:;" class="home_header_2_Click">不限</a></li>
						<li><a href="javascript:;" value="1">10以下</a></li>
						<li><a href="javascript:;" value="2">10~30</a></li>
						<li><a href="javascript:;" value="3">30以上</a></li>
					</ul>
				</li>
			</ul>
			<button class="btn btn-primary" id="CaseScreen" type="submit" style="padding: 4px 40px;background: #2459aa;margin-left: 15px;display: none;">筛选</button>
			<div class="home_header_2_Arrow home_header_2_Arrow_true">
				<img src="<c:url value='/share/images/Arrow.png'></c:url>" class="transform_rotate">
			</div>
		</div>
	</div>

	<div class="home_content Interface_center">
		<div class="input-group input-group" style="float: right;width: 290px;margin-top: 15px;margin-bottom: 24px;">
			<input type="text" name="caseName" id="caseName" value="" placeholder="输入案例内容" class="form-control" size="40" style="border: 1px solid #82bcff;">
			<span class="input-group-btn">
				<button class="btn btn-primary" id="searchBtn" type="submit" style="background:#82bcff;border-color: #82bcff;font-weight: 300;">搜索</button>
			</span>
		</div>
		<table class="table case_table">
	    	<thead style="background: #2459aa; color: #fff;border: 1px solid #337ab7;">
		        <tr>
		          <th>序号</th>
		          <th style="padding-left: 20px;padding-right: 20px;">案例名称</th>
		          <th>案例类型</th>
		          <th>国家地区</th>
		          <th>涉事人数</th>
		          <th>出境目的</th>
		          <th style="padding-left: 20px;padding-right: 20px;text-align: right;">案例发布时间</th>
		        </tr>
		    </thead>
	      <tbody id="case_details">
	      </tbody>
	    </table>
		<br>
		<br>
		<div id="WH-pagebar" class="WH-pagebar"></div>
		<br>
		<br>
	</div>

	<script type="text/javascript">
		var rootPath = '${rootPath}';
		
		var filterHelper = gridFilter();
		var home_index;//当前分页码
		var wh_count;//总页数
		$(function(){
			//日期选择器
			var ths;
			var num = 0;
			var obj = "";
			var IfTimt2 = 0;
			var IfTimt3 = 0;
			$("#Text2").on("click",function (e) {
				//event.stopPropagation();
				ths = this;
				num++;
				if(num % 2 == 0){
					calendar.colse({
						id: ths, ok: function () {
							//alert(ths.value);
						}
					});
				}else{
					calendar.show({
						id: ths, ok: function () {
							//alert(ths.value);
							IfTimt2 = ths.value;
							if(IfTimt2 > IfTimt3){
								alert('起始时间不能大于结束时间');
								$('#Text2').attr('date','');
							}
						}
					});
					num++;
				}
			});
			$("#Text3").on("click",function (e) {
				//event.stopPropagation();
				ths = this;
				num++;
				if(num % 2 == 0){
					calendar.colse({
						id: ths, ok: function () {
							//alert(ths.value);
						}
					});
				}else{
					calendar.clear();
					calendar.show({
						id: ths, ok: function () {
							//alert(ths.value);
							IfTimt3 = ths.value;
						}
					});
					num++;
				}
			});
			/* $(document).on("click", function(){
				if(num % 2 != 0){
					if(IfTimt2 > IfTimt3){
						$('#Text2').attr('date','');
						alert('起始时间不能大于结束时间');
					}
					num++;
				}
			}); */
			Case_init();
			function Case_init(){
				$.ajax({
					url: "<c:url value='/common/country'></c:url>",
					type: "POST",
		    		dataType: "JSON",
		    		data:{},
					success:function(data){
						var html = "";
						for(var i in data){
							html = '<option value="'+ data[i].zh_name +'">'+ data[i].zh_name +'</option>';
							$("#Case_Country_Area_select").append(html);
						}
					},
					error:function(){
						//console.log(error);
					}
				});
			}
			//判断是否有列表
			if($("#case_details").html() == ""){
				$(".pagination").html("");
			}
			//筛选
			$("#CaseScreen,#searchBtn").click(function(){
				//清空
				empty();
				//案例名称
				var caseName = $("#caseName").val();
				//案例类型
				var Case_Type1 = $("#Case_Type1 option:checked").attr("value") == undefined?"":$("#Case_Type1 option:checked").attr("value");
				var Case_Type2 = $("#Case_Type2 option:checked").attr("value") == undefined?"":$("#Case_Type2 option:checked").attr("value");
				var Case_Type3 = $("#Case_Type3 option:checked").attr("value") == undefined?"":$("#Case_Type3 option:checked").attr("value");
				//时间
				var Text2 = $("#Text2").attr('date') == undefined?"":$("#Text2").attr('date');
				var Text3 = $("#Text3").attr('date') == undefined?"":$("#Text3").attr('date');
				//国家/地区
				var CountryAreaSelect = $("#Case_Country_Area_select option:checked").attr("value") == undefined?"":$("#Case_Country_Area_select option:checked").attr("value");
				//辖区范围
				var CaseRange = "";
				CaseRange = $("#Case_Range").val();
				//涉事人数
				var PeopleNumber = "";
				PeopleNumber = $("#Case_PeopleNumber li a.home_header_2_Click").html();
				var P_PNstr = PeopleNumber.indexOf("~");
				var P_PNFront = PeopleNumber.substring(0,P_PNstr);//获取之前数
				var P_PNBack = PeopleNumber.substring(P_PNstr+1);//获取之后数
				var P_value = P_PNBack.replace(/[^0-9]/ig,"");//只获取数字
				//出境目的
				var ExitPurpose = "";
				ExitPurpose = $("#Case_Exit_Purpose li a.home_header_2_Click").html() == "不限"?"":$("#Case_Exit_Purpose li a.home_header_2_Click").html();
				//伤亡人数
				var CasualtiesNumber = "";
				CasualtiesNumber = $("#Case_CasualtiesNumber li a.home_header_2_Click").html();
				var C_PNstr = CasualtiesNumber.indexOf("~");
				var C_PNFront = CasualtiesNumber.substring(0,C_PNstr);//获取之前数
				var C_PNBack = CasualtiesNumber.substring(C_PNstr+1);//获取之后数
				var C_value = C_PNBack.replace(/[^0-9]/ig,"");//只获取数字
				//死亡人数
				var DeathNumber = "";
				DeathNumber = $("#Case_DeathNumber li a.home_header_2_Click").html();
				var D_PNstr = DeathNumber.indexOf("~");
				var D_PNFront = DeathNumber.substring(0,D_PNstr);//获取之前数
				var D_PNBack = DeathNumber.substring(D_PNstr+1);//获取之后数
				var D_value = D_PNBack.replace(/[^0-9]/ig,"");//只获取数字
				var Case_SubmitObject = {
					caseName: caseName,//案例名称
					class1: Case_Type1,//案例类型一
					class2: Case_Type2,//案例类型二
					class3: Case_Type3,//案例类型三
					time1: Text2,//开始时间
					time2: Text3,//结束时间
					country_area: CountryAreaSelect,//国家/地区
					area_range: CaseRange,//辖区范围
					P_PNFront: P_PNFront,//涉事人数开始
					P_value: P_value,//涉事人数结束
					ExitPurpose: ExitPurpose,//出境目的
					C_PNFront: C_PNFront,//伤亡人数开始
					C_value: C_value,//伤亡人数结束
					D_PNFront: D_PNFront,//死亡人数开始
					D_value: D_value,//死亡人数结束
				}
				Case_SelectInit(Case_SubmitObject);
			});
			$(".home_header-nav li").click(function(){
				$(".home_header-nav li a").removeClass("home_header_1_ClickA");
				$(this).children().addClass("home_header_1_ClickA");
			});
			$(".home_header_2 .Interface_center>ul>li:eq(4) ul li").click(function(){
				$(".home_header_2 .Interface_center>ul>li:eq(4) ul li a").removeClass("home_header_2_Click");
				$(this).children().addClass("home_header_2_Click");
			});
			$(".home_header_2 .Interface_center>ul>li:eq(5) ul li").click(function(){
				$(".home_header_2 .Interface_center>ul>li:eq(5) ul li a").removeClass("home_header_2_Click");
				$(this).children().addClass("home_header_2_Click");
			});
			$(".home_header_2 .Interface_center>ul>li:eq(6) ul li").click(function(){
				$(".home_header_2 .Interface_center>ul>li:eq(6) ul li a").removeClass("home_header_2_Click");
				$(this).children().addClass("home_header_2_Click");
			});
			$(".home_header_2 .Interface_center>ul>li:eq(7) ul li").click(function(){
				$(".home_header_2 .Interface_center>ul>li:eq(7) ul li a").removeClass("home_header_2_Click");
				$(this).children().addClass("home_header_2_Click");
			});
			$(".home_header_2_Arrow").click(function(){
				if(!$(this).is(".home_header_2_Arrow_true")){
					$(this).prevAll().hide();
					$(this).children().addClass("transform_rotate");
					$(this).addClass("home_header_2_Arrow_true");
				}else{
					$(this).prevAll().show();
					$(this).children().removeClass("transform_rotate");
					$(this).removeClass("home_header_2_Arrow_true");
				}
			});
			Case_SelectInit(obj,0);//初始化
			//数据传递接收
			var isFirst = true;
			function Case_SelectInit(obj,home_index){
				filterHelper.clearFilterData();
				//涉事人数
				var type = $("#Case_PeopleNumber li a.home_header_2_Click").attr('value');//涉事人数
				if (type != ""){
					switch(type){ 
						case "1":
							start_end("involved_num",obj.P_PNFront,obj.P_value); 
							break;
						case "2":
							start_end("involved_num",obj.P_PNFront,obj.P_value);
							break;
						case "3":
							start_end("involved_num",obj.P_PNFront,obj.P_value);
							break;
						case "4":
							start_end("involved_num",obj.P_value,obj.P_PNFront);
							break;
						default:; 
					} 
				}
				//伤亡人数
				var type = $("#Case_CasualtiesNumber li a.home_header_2_Click").attr('value');//伤亡人数
				if (type != ""){
					switch(type){ 
						case "1":
							start_end("injured_num",obj.C_PNFront,obj.C_value); 
							break;
						case "2":
							start_end("injured_num",obj.C_PNFront,obj.C_value);
							break;
						case "3":
							start_end("injured_num",obj.C_PNFront,obj.C_value);
							break;
						case "4":
							start_end("injured_num",obj.C_value,obj.C_PNFront);
							break;
						default:; 
					} 
				}
				//死亡人数
				var type = $("#Case_DeathNumber li a.home_header_2_Click").attr('value');//死亡人数
				if (type != ""){
					switch(type){ 
						case "1":
							start_end("death_num",obj.D_PNFront,obj.D_value); 
							break;
						case "2":
							start_end("death_num",obj.D_PNFront,obj.D_value);
							break;
						case "3":
							start_end("death_num",obj.D_value,obj.D_PNFront);
							break;
						default:; 
					} 
				}
				var url = "<c:url value='/case/study/list'></c:url>";
				var obj = obj == ""?"":obj;
				var class1 = obj.class1 == ""?"":obj.class1;
				var class2 = obj.class2 == ""?"":obj.class2;
				var class3 = obj.class3 == ""?"":obj.class3;
				var time1 = obj.time1 == ""?"":obj.time1;
				var time2 = obj.time2 == ""?"":obj.time2;
				//开始时间
				if (time1 != "") {
					var filterdata = filterHelper.formFilterData("time", time1,
							'', 'GREATER_EQUALS', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				//结束时间
				if (time2 != "") {
					var filterdata = filterHelper.formFilterData("time", time2,
							'', 'LESS_EQUALS', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				//console.log(JSON.stringify(filterHelper.getFilterData()));
				var country_area = obj.country_area == ""?"":obj.country_area;
				var area_range = obj.area_range == ""?"":obj.area_range;
				var ExitPurpose = obj.ExitPurpose == ""?"":obj.ExitPurpose;
				var caseName = obj.caseName;
				substring("class1",class1);//案例类型一
				substring("class2",class2);//案例类型一
				substring("class3",class3);//案例类型一
				//substring("time",time);//时间
				substring("country_area",country_area);//国家/地区
				//substring("area_range",area_range);//辖区范围
				if (area_range != "") {
					var filterdata = filterHelper.formFilterData("country_area", area_range,
							'', 'CONTAIN', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				/* 案例名称 改成 案例内容 */
				if (caseName != "") {
					//
					var filterdata = filterHelper.formFilterData("content", caseName,
							'', 'CONTAIN', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				substring("exit_purpose",ExitPurpose);//出境目的
				var CaseFilterdata = JSON.stringify(filterHelper.getFilterData());
				var PageSize = 20;//总页码 
				$.ajax({
					url: url,
					type: 'POST',
					dataType: 'html',
					data:{
						"pageIndex" : home_index,//当前分页码
						"pageSize" : PageSize,//总页码 
						"sortOrder" : "desc",//默认逆序desc
						"filterdata" : CaseFilterdata
					},
					success:function(data){
						var obj = gridDataFormat(data);
						var s_num = obj.count / PageSize;
						wh_count = obj.count;
						if(obj == "" || wh_count == 0){
							$("#case_details").html("");
							$("#WH-pagebar").html("");
						}
						/* var html = "";
						if(obj == "" || wh_count == 0){
							$("#case_details").html("");
							$("#WH-pagebar").html("");
						}
						home_index = home_index == undefined?0:home_index;
						var Index = PageSize * home_index;
						for(var i = 0; obj.data.length > i; i++){
							var substr = "";
							var SubNum = obj.data[i].name.substring(0,18);
							if(obj.data[i].auditTime != null){
								substr = obj.data[i].auditTime.substring(0, 10);
							}
							html += '<tr onclick=\"javascript:study('+obj.data[i].id+')\">'+
							          '<td>'+ (Index+i+1) +'</td>'+
							          '<td title="'+ SubNum +'" style="padding-left: 20px;padding-right: 20px;">'+ SubNum +'</td>'+
							          '<td>'+ obj.data[i].class1 +'</td>'+
							          '<td>'+ obj.data[i].country_area +'</td>'+
							          '<td>'+ obj.data[i].involved_num +'</td>'+
							          '<td>'+ obj.data[i].exit_purpose +'</td>'+
							          '<td style="padding-left: 20px;padding-right: 20px;text-align: right;">'+ substr +'</td>'+
							        '</tr>';
						}
					    $("#case_details").html(html); */
						creatPageBar(wh_count,PageSize,obj,CaseFilterdata);
					},
					complete : function(XMLHttpRequest, textStatus) {
					},
					error : function() {
						//
					}
				});
			}
			
			function creatPageBar(count,PageSize,obj,CaseFilterdata){
				var WHPageBar = document.getElementById('WH-pagebar');
				var CurrentPage = 1;//起始页
				var SingleCount = Math.ceil(count/PageSize)>5?5:Math.ceil(count/PageSize);//翻页显示个数
				var PageCount = Math.ceil(count/PageSize);//总页数
				WHPageBar.innerHTML="";
				WH_Pagebar({
					id:'WH-pagebar', //容器ID : 必选参数
					CurrentPage:CurrentPage,   //当前页 ： 可选参数，默认值为1
					SingleCount:SingleCount,   //显示数目： 可选参数，只能为奇数，默认值为7，
					PageCount:PageCount,   //必选参数
					callback : function(pagenow,pagecount){		
						//'当前页:' + pagenow +',总共页:'+pagecount;
						$("#home_Page_video_audio_text").html("");
						Case_SelectEnd(obj, pagenow - 1,PageSize,CaseFilterdata);
					}
				})
			}
			
			function Case_SelectEnd(obj,home_index,PageSize,CaseFilterdata){
				filterHelper.clearFilterData();
				//涉事人数
				var type = $("#Case_PeopleNumber li a.home_header_2_Click").attr('value');//涉事人数
				if (type != ""){
					switch(type){ 
						case "1":
							start_end("involved_num",obj.P_PNFront,obj.P_value); 
							break;
						case "2":
							start_end("involved_num",obj.P_PNFront,obj.P_value);
							break;
						case "3":
							start_end("involved_num",obj.P_PNFront,obj.P_value);
							break;
						case "4":
							start_end("involved_num",obj.P_value,obj.P_PNFront);
							break;
						default:; 
					} 
				}
				//伤亡人数
				var type = $("#Case_CasualtiesNumber li a.home_header_2_Click").attr('value');//伤亡人数
				if (type != ""){
					switch(type){ 
						case "1":
							start_end("injured_num",obj.C_PNFront,obj.C_value); 
							break;
						case "2":
							start_end("injured_num",obj.C_PNFront,obj.C_value);
							break;
						case "3":
							start_end("injured_num",obj.C_PNFront,obj.C_value);
							break;
						case "4":
							start_end("injured_num",obj.C_value,obj.C_PNFront);
							break;
						default:; 
					} 
				}
				//死亡人数
				var type = $("#Case_DeathNumber li a.home_header_2_Click").attr('value');//死亡人数
				if (type != ""){
					switch(type){ 
						case "1":
							start_end("death_num",obj.D_PNFront,obj.D_value); 
							break;
						case "2":
							start_end("death_num",obj.D_PNFront,obj.D_value);
							break;
						case "3":
							start_end("death_num",obj.D_value,obj.D_PNFront);
							break;
						default:; 
					} 
				}
				var url = "<c:url value='/case/study/list'></c:url>";
				var obj = obj == ""?"":obj;
				var class1 = obj.class1 == ""?"":obj.class1;
				var class2 = obj.class2 == ""?"":obj.class2;
				var class3 = obj.class3 == ""?"":obj.class3;
				var time1 = obj.time1 == ""?"":obj.time1;
				var time2 = obj.time2 == ""?"":obj.time2;
				//时间筛选
				if (time1 != "") {
					//class_form课程形式
					var filterdata = filterHelper.formFilterData("time", time1,
							'', 'CONTAIN', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				if (time2 != "") {
					//class_form课程形式
					var filterdata = filterHelper.formFilterData("time", time2,
							'', 'CONTAIN', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				//console.log(JSON.stringify(filterHelper.getFilterData()));
				var country_area = obj.country_area == ""?"":obj.country_area;
				var area_range = obj.area_range == ""?"":obj.area_range;
				var ExitPurpose = obj.ExitPurpose == ""?"":obj.ExitPurpose;
				var caseName = obj.caseName;
				substring("class1",class1);//案例类型一
				substring("class2",class2);//案例类型一
				substring("class3",class3);//案例类型一
				//substring("time",time);//时间
				substring("country_area",country_area);//国家/地区
				//substring("area_range",area_range);//辖区范围
				if (area_range != "") {
					var filterdata = filterHelper.formFilterData("country_area", area_range,
							'', 'CONTAIN', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				/* 案例名称 */
				if (caseName != "") {
					//class_form课程形式
					var filterdata = filterHelper.formFilterData("name", caseName,
							'', 'CONTAIN', 'AND');
					filterHelper.addFilterData(filterdata);
				}
				substring("exit_purpose",ExitPurpose);//出境目的
				$.ajax({
					url: url,
					type: 'POST',
					dataType: 'html',
					data:{
						"pageIndex" : home_index,//当前分页码
						"pageSize" : PageSize,//总页码 
						"sortOrder" : "desc",//默认逆序desc
						"filterdata" : CaseFilterdata
					},
					success:function(data){
						var obj = gridDataFormat(data);
						var s_num = obj.count / PageSize;
						console.log(obj);
						wh_count = obj.count;
						var html = "";
						if(obj == ""){
							$("#case_details").html("");
						}
						var Index = PageSize * home_index;
						for(var i = 0; obj.data.length > i; i++){
							var substr = "";
							var SubNum = obj.data[i].name.substring(0,18);
							if(obj.data[i].time != null){
								substr = obj.data[i].time.substring(0, 10);
							}
							html += '<tr onclick=\"javascript:study('+obj.data[i].id+')\">'+
							          '<td>'+ (Index+i+1) +'</td>'+
							          '<td title="'+ SubNum +'" style="padding-left: 20px;padding-right: 20px;">'+ SubNum +'</td>'+
							          '<td>'+ obj.data[i].class1 +'</td>'+
							          '<td>'+ obj.data[i].country_area +'</td>'+
							          '<td>'+ obj.data[i].involved_num +'</td>'+
							          '<td>'+ obj.data[i].exit_purpose +'</td>'+
							          '<td style="padding-left: 20px;padding-right: 20px;text-align: right;">'+ substr +'</td>'+
							        '</tr>';
						}
					    $("#case_details").html(html);
					},
					complete : function(XMLHttpRequest, textStatus) {
					},
					error : function() {
						//
					}
				});
			}
			
			//人数间值方法
			function start_end(type,start,end){
				if(start != "" && end != ""){
					var filterdata_start = filterHelper.formFilterData(type, start,
							'', 'GREATER_EQUALS', 'AND');
					filterHelper.addFilterData(filterdata_start);
					var filterdata_end = filterHelper.formFilterData(type, end,
							'', 'LESS_EQUALS', 'AND');
					filterHelper.addFilterData(filterdata_end);
				}else if(start == "" && end != ""){
					var filterdata_end = filterHelper.formFilterData(type, end,
							'', 'LESS_EQUALS', 'AND');
					filterHelper.addFilterData(filterdata_end);
				}else{
					var filterdata_start = filterHelper.formFilterData(type, start,
							'', 'GREATER_EQUALS', 'AND');
					filterHelper.addFilterData(filterdata_start);
				}
			}
			//字符串值方法
			function substring(type,value){
				if (value != "") {
					//class_form课程形式
					var filterdata = filterHelper.formFilterData(type, value,
							'', 'EQUALS', 'AND');
					filterHelper.addFilterData(filterdata);
				}
			}

			//封装清空所有
			function empty() {
				$("#home_Page_video_audio_text").html("");//每次点击时先清空,进行加载新的列表
				$(".pagination *").remove();//每次进行筛选时,进行提前页码清空
			}
		});
		
		function study(id){
			window.open(rootPath+'/case/study/detail/'+id);
		}
	</script>
</body>
</html>
